package com.marvels.approve.common.service.impl;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.marvels.approve.common.dto.EdcSharedDataDTO;
import com.marvels.approve.common.service.SharedDataMqProvideApi;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.common.utils.MarvelsLogUtil;
import com.marvels.common.utils.ServerProperties;

@Service
public class SharedDataMqProvideImpl implements SharedDataMqProvideApi{

	@Autowired
	private AmqpTemplate amqpTemplate;
	
	@Value("${config.properties.path}")
	private String configPropertiesPath;
	
	@Override
	public void synSharedData(EdcSharedDataDTO synStatus) throws MarvelsBusinessException {
		String json = JSON.toJSONString(synStatus);
		MarvelsLogUtil.getInstance().info(">>>>>>sharing_platform_data_modify请求数据"+json+"mq请求开始");
		amqpTemplate.convertAndSend("sharing_platform_data_modify",json);
		MarvelsLogUtil.getInstance().info(">>>>>>sharing_platform_data_modify请求数据"+json+"mq请求结束");
	}

}
